
package gui;

import business.Categoria;
import java.util.Locale;
import java.util.ResourceBundle;
import javax.swing.JFrame;
import vo.FuncionarioVO;
import gui.Login;

public class Principal extends javax.swing.JFrame {

    private static Principal instance;
    //private FuncionarioVO funcionarioLogado;
    private String Loged;
    
    public Principal() {
        
        
        initComponents();
        
    }
         
    public static Principal getInstance(){
        if (instance == null)
            instance = new Principal();
        return instance;
    }

    public String getFuncionarioLogado() {
        return Loged;
    }

    public void setFuncionarioLogado(String login) {
        this.Loged = login;
    }
    
    private ResourceBundle bundle;
    
    public void atualizabarra() {
        
        bundle = ResourceBundle.getBundle("gui/Bundle");
        
        jMenuLocação.setText(bundle.getString("Principal.jMenuLocação.text"));
        jMenuItemReservaEfetivar.setText(bundle.getString("Principal.jMenuItemReservaEfetivar.text"));
        jMenuReserva.setText(bundle.getString("Principal.jMenuReserva.text"));
        jMenuItemReservaCriar.setText(bundle.getString("Principal.jMenuItemReservaCriar.text"));
        jMenuItemReservaApagar.setText(bundle.getString("Principal.jMenuItemReservaApagar.text"));
        jMenuItemReservaAlterar.setText(bundle.getString("Principal.jMenuItemReservaAlterar.text"));
        jMenuItemLocacaoFinalizar.setText(bundle.getString("Principal.jMenuItemLocacaoFinalizar.text"));
        jMenuItemGerenciamentoOpcionais.setText(bundle.getString("Principal.jMenuItemGerenciamentoOpcionais.text"));
        jMenuItemGerenciamentoFuncionarios.setText(bundle.getString("Principal.jMenuItemGerenciamentoFuncionarios.text"));
        jMenuItemGerenciamentoClientes.setText(bundle.getString("Principal.jMenuItemGerenciamentoClientes.text"));
        jMenuItemGerenciamentoCategorias.setText(bundle.getString("Principal.jMenuItemGerenciamentoCategorias.text"));
        jMenuItemGerenciamentoCarros.setText(bundle.getString("Principal.jMenuItemGerenciamentoCarros.text"));
        jMenuGerenciamento.setText(bundle.getString("Principal.jMenuGerenciamento.text"));
        jLabel1.setText(bundle.getString("Principal.jLabel1.text"));
          
    }
    
    
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
        java.awt.GridBagConstraints gridBagConstraints;

        buttonGroup1 = new javax.swing.ButtonGroup();
        jLabel1 = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jMenuBar = new javax.swing.JMenuBar();
        jMenuGerenciamento = new javax.swing.JMenu();
        jMenuItemGerenciamentoCarros = new javax.swing.JMenuItem();
        jMenuItemGerenciamentoClientes = new javax.swing.JMenuItem();
        jMenuItemGerenciamentoOpcionais = new javax.swing.JMenuItem();
        jMenuItemGerenciamentoCategorias = new javax.swing.JMenuItem();
        jMenuReserva = new javax.swing.JMenu();
        jMenuItemReservaCriar = new javax.swing.JMenuItem();
        jMenuItemReservaAlterar = new javax.swing.JMenuItem();
        jMenuItemReservaApagar = new javax.swing.JMenuItem();
        jMenuItemReservaEfetivar = new javax.swing.JMenuItem();
        jMenuLocação = new javax.swing.JMenu();
        jMenuItemLocacaoFinalizar = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("gui/Bundle"); // NOI18N
        setTitle(bundle.getString("Principal.title")); // NOI18N
        setBackground(new java.awt.Color(102, 102, 102));
        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        setIconImages(null);
        setMinimumSize(new java.awt.Dimension(1000, 800));
        setResizable(false);
        getContentPane().setLayout(new java.awt.GridBagLayout());

        jLabel1.setText(bundle.getString("Principal.jLabel1.text")); // NOI18N
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.ipadx = 26;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(192, 305, 0, 0);
        getContentPane().add(jLabel1, gridBagConstraints);

        jButton1.setText(bundle.getString("Principal.jButton1.text")); // NOI18N
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.gridheight = 2;
        gridBagConstraints.ipadx = 16;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(188, 4, 188, 0);
        getContentPane().add(jButton1, gridBagConstraints);

        jButton2.setText(bundle.getString("Principal.jButton2.text")); // NOI18N
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.gridheight = 2;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(188, 6, 188, 253);
        getContentPane().add(jButton2, gridBagConstraints);

        jMenuGerenciamento.setText(bundle.getString("Principal.jMenuGerenciamento.text")); // NOI18N

        jMenuItemGerenciamentoCarros.setText(bundle.getString("Principal.jMenuItemGerenciamentoCarros.text")); // NOI18N
        jMenuItemGerenciamentoCarros.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemGerenciamentoCarrosActionPerformed(evt);
            }
        });
        jMenuGerenciamento.add(jMenuItemGerenciamentoCarros);

        jMenuItemGerenciamentoClientes.setText(bundle.getString("Principal.jMenuItemGerenciamentoClientes.text")); // NOI18N
        jMenuItemGerenciamentoClientes.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemGerenciamentoClientesActionPerformed(evt);
            }
        });
        jMenuGerenciamento.add(jMenuItemGerenciamentoClientes);

        jMenuItemGerenciamentoOpcionais.setText(bundle.getString("Principal.jMenuItemGerenciamentoOpcionais.text")); // NOI18N
        jMenuItemGerenciamentoOpcionais.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemGerenciamentoOpcionaisActionPerformed(evt);
            }
        });
        jMenuGerenciamento.add(jMenuItemGerenciamentoOpcionais);

        jMenuItemGerenciamentoCategorias.setText(bundle.getString("Principal.jMenuItemGerenciamentoCategorias.text")); // NOI18N
        jMenuItemGerenciamentoCategorias.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemGerenciamentoCategoriasActionPerformed(evt);
            }
        });
        jMenuGerenciamento.add(jMenuItemGerenciamentoCategorias);

        jMenuBar.add(jMenuGerenciamento);

        jMenuReserva.setText(bundle.getString("Principal.jMenuReserva.text")); // NOI18N

        jMenuItemReservaCriar.setText(bundle.getString("Principal.jMenuItemReservaCriar.text")); // NOI18N
        jMenuItemReservaCriar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemReservaCriarActionPerformed(evt);
            }
        });
        jMenuReserva.add(jMenuItemReservaCriar);

        jMenuItemReservaAlterar.setText(bundle.getString("Principal.jMenuItemReservaAlterar.text")); // NOI18N
        jMenuItemReservaAlterar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemReservaAlterarActionPerformed(evt);
            }
        });
        jMenuReserva.add(jMenuItemReservaAlterar);

        jMenuItemReservaApagar.setText(bundle.getString("Principal.jMenuItemReservaApagar.text")); // NOI18N
        jMenuItemReservaApagar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemReservaApagarActionPerformed(evt);
            }
        });
        jMenuReserva.add(jMenuItemReservaApagar);

        jMenuItemReservaEfetivar.setText(bundle.getString("Principal.jMenuItemReservaEfetivar.text")); // NOI18N
        jMenuItemReservaEfetivar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemReservaEfetivarActionPerformed(evt);
            }
        });
        jMenuReserva.add(jMenuItemReservaEfetivar);

        jMenuBar.add(jMenuReserva);

        jMenuLocação.setText(bundle.getString("Principal.jMenuLocação.text")); // NOI18N

        jMenuItemLocacaoFinalizar.setText(bundle.getString("Principal.jMenuItemLocacaoFinalizar.text")); // NOI18N
        jMenuItemLocacaoFinalizar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemLocacaoFinalizarActionPerformed(evt);
            }
        });
        jMenuLocação.add(jMenuItemLocacaoFinalizar);

        jMenuBar.add(jMenuLocação);

        setJMenuBar(jMenuBar);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jMenuItemGerenciamentoCarrosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemGerenciamentoCarrosActionPerformed
        this.getContentPane().removeAll();
        this.getContentPane().revalidate();
        repaint();
        Veiculo_Principal Panel= Veiculo_Principal.getInstance();
        this.add(Panel);
        this.revalidate();
    }//GEN-LAST:event_jMenuItemGerenciamentoCarrosActionPerformed

    private void jMenuItemGerenciamentoCategoriasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemGerenciamentoCategoriasActionPerformed
        this.getContentPane().removeAll();
        this.getContentPane().revalidate();
        repaint();
        Categoria_Principal panel= Categoria_Principal.getInstance();
        this.add(panel);
        this.revalidate();
    }//GEN-LAST:event_jMenuItemGerenciamentoCategoriasActionPerformed

    private void jMenuItemGerenciamentoClientesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemGerenciamentoClientesActionPerformed
        this.getContentPane().removeAll();
        this.getContentPane().revalidate();
        repaint();
        Pessoa_Principal panel= Pessoa_Principal.getInstance();
        this.add(panel);
        this.revalidate();
    }//GEN-LAST:event_jMenuItemGerenciamentoClientesActionPerformed

    private void jMenuItemGerenciamentoOpcionaisActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemGerenciamentoOpcionaisActionPerformed
        this.getContentPane().removeAll();
        this.getContentPane().revalidate();
        repaint();
        Opcionais_Principal panel = Opcionais_Principal.getInstance();
        this.add(panel);
        this.revalidate();
    }//GEN-LAST:event_jMenuItemGerenciamentoOpcionaisActionPerformed

    private void jMenuItemReservaCriarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemReservaCriarActionPerformed
        this.getContentPane().removeAll();
        this.getContentPane().revalidate();
        repaint();
        Reserva_Criar Panel= new Reserva_Criar();
        this.add(Panel);
        this.revalidate();   
    }//GEN-LAST:event_jMenuItemReservaCriarActionPerformed

    private void jMenuItemReservaAlterarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemReservaAlterarActionPerformed
        this.getContentPane().removeAll();
        this.getContentPane().revalidate();
        repaint();
        Reserva_Alterar Panel= new Reserva_Alterar();
        this.add(Panel);
        this.revalidate();        
    }//GEN-LAST:event_jMenuItemReservaAlterarActionPerformed

    private void jMenuItemReservaApagarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemReservaApagarActionPerformed
        this.getContentPane().removeAll();
        this.getContentPane().revalidate();
        repaint();
        Reserva_Apagar Panel= new Reserva_Apagar();
        this.add(Panel);
        this.revalidate();       
    }//GEN-LAST:event_jMenuItemReservaApagarActionPerformed

    private void jMenuItemReservaEfetivarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemReservaEfetivarActionPerformed
        this.getContentPane().removeAll();
        this.getContentPane().revalidate();
        repaint();
        Reserva_Efetivar Panel= new Reserva_Efetivar();
        this.add(Panel);
        this.revalidate();        
    }//GEN-LAST:event_jMenuItemReservaEfetivarActionPerformed

    private void jMenuItemLocacaoFinalizarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemLocacaoFinalizarActionPerformed
        this.getContentPane().removeAll();
        this.getContentPane().revalidate();
        repaint();
        Locacao_Finalizar Panel= new Locacao_Finalizar();
        this.add(Panel);
        this.revalidate();        
    }//GEN-LAST:event_jMenuItemLocacaoFinalizarActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // TODO add your handling code here:
        
        Locale locale = new Locale("en","US");
        Locale.setDefault(locale);
        
        atualizabarra();
        
        this.validate();
        this.repaint();
        
        
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        // TODO add your handling code here:
        
        Locale locale = new Locale("pt","BR");
        Locale.setDefault(locale);
        
        atualizabarra();
        
        this.validate();
        this.repaint();
        
    }//GEN-LAST:event_jButton2ActionPerformed

    
  public static void main(String args[]) {
             
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
     
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                instance = new Principal();
                instance.setExtendedState(JFrame.MAXIMIZED_BOTH);
                instance.setVisible(false);
                new Login().setVisible(true);
                
                
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JMenuBar jMenuBar;
    private javax.swing.JMenu jMenuGerenciamento;
    private javax.swing.JMenuItem jMenuItemGerenciamentoCarros;
    private javax.swing.JMenuItem jMenuItemGerenciamentoCategorias;
    private javax.swing.JMenuItem jMenuItemGerenciamentoClientes;
    private javax.swing.JMenuItem jMenuItemGerenciamentoOpcionais;
    private javax.swing.JMenuItem jMenuItemLocacaoFinalizar;
    private javax.swing.JMenuItem jMenuItemReservaAlterar;
    private javax.swing.JMenuItem jMenuItemReservaApagar;
    private javax.swing.JMenuItem jMenuItemReservaCriar;
    private javax.swing.JMenuItem jMenuItemReservaEfetivar;
    private javax.swing.JMenu jMenuLocação;
    private javax.swing.JMenu jMenuReserva;
    // End of variables declaration//GEN-END:variables
}
